package com.lanxigua.ui.sale;

import java.util.List;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.lanxigua.entity.Sale;
import com.lanxigua.ui.Base;
import com.lanxigua.ui.R;
import com.lanxigua.utils.ErrorException;

public class Today extends Base {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
//		this.hideTitle();
		setContentView(R.layout.sale_today);
//
//		WebView webView = (WebView) findViewById(R.id.wbvSaleFeatured);
//		webView.getSettings().setJavaScriptEnabled(true);
//		webView.loadUrl("http://i.lanxigua.com");
//
//		webView.setWebViewClient(new WebViewClient() {
//			public boolean shouldOverrideUrlLoading(WebView view, String url) {
//				view.loadUrl(url);
//				return true;
//			}
//		});

		Handler handler = new Handler() {
			public void handleMessage(Message message) {
				try {
					com.lanxigua.entity.Sale sale = new Sale(message);
					List<Sale> saleList = sale.list;
					Tooltips.alert(Integer.toString(saleList.size()));
				} catch (ErrorException e) {
					Tooltips.info(e.getMessage());
				}
			}
		};
		try {
			new com.lanxigua.adapter.Sale(handler).getFeatured(1, 1);
		} catch (Exception e) {
			
		}
	}
}
